const SYS_USER_ID = 'SYS_USER_ID';
const SYS_USER_NAME = 'SYS_USER_NAME';
const SYS_USER_ACCOUNT = 'SYS_USER_ACCOUNT';
const SYS_USER_MOBILE = 'SYS_USER_MOBILE';
const SYS_DEP_ID = 'SYS_DEP_ID';
const SYS_DEP_NAME = 'SYS_DEP_NAME';
const SYS_APPLY_DATE = 'SYS_APPLY_DATE';
const SYS_APPLY_NO = 'SYS_APPLY_NO';

function gennerateScript(fnBody) {
    const fn = new Function(`{${vibeVariableKeyList.join(',')}}`, `return (${fnBody})`);

    return fn;
}

const vibeVariable = {
    [SYS_USER_ID]: '',
    [SYS_USER_NAME]: '',
    [SYS_USER_ACCOUNT]: '',
    [SYS_USER_MOBILE]: '',
    [SYS_DEP_ID]: '',
    [SYS_DEP_NAME]: '',
    [SYS_APPLY_DATE]: '',
    [SYS_APPLY_NO]: ''
};

const vibeVariableKeyList = Object.keys(vibeVariable);

export { vibeVariable, vibeVariableKeyList, gennerateScript };
